package com.jy.bo.common.conf.enums;

/**
 * @program: binary-option
 * @description
 * @author: binary
 * @create: 2020-06-17 16:04
 **/
public enum ProductEnum {

    EUR_USD("EUR/USD", "F_EUR_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/EUR_USD_100x100.png", 6),
    GBP_USD("GBP/USD", "F_GBP_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/GBPUSD.png", 6),
    INR_USD("INR/USD", "F_INR_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/INR_USD_100x100.png", 8),
    JPY_USD("JPY/USD", "F_JPY_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/JPY_USD_100x100.png", 8),
    ETH_USD("ETH/USD", "C_ETH_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/ETHUSD.png", 2),
    BTC_USD("BTC/USD", "C_BTC_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/BTCUSD.png", 2),
    EUR_JPY("EUR/JPY", "F_EUR_JPY", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/EUR_JPY_100x100.png", 4),
    AUD_USD("AUD/USD", "F_AUD_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/AUD_USD_100x100.png", 5),
    AUD_EUR("AUD/EUR", "F_AUD_EUR", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/AUD_EUR_100x100.png", 7),
    XRP_USD("XRP/USD", "C_XRP_USD", "https://cm-binary.oss-ap-south-1.aliyuncs.com/product/XRP_USD.png", 7),
    ;

    ProductEnum(String name, String productCode, String logo, int tailNum) {
        this.name = name;
        this.productCode = productCode;
        this.logo = logo;
        this.tailNum = tailNum;
    }

    private String name;
    private String productCode;

    private String logo;

    //小数点位数
    private int tailNum;

    public String getName() {
        return name;
    }

    public ProductEnum setName(String name) {
        this.name = name;
        return this;
    }

    public String getProductCode() {
        return productCode;
    }

    public ProductEnum setProductCode(String productCode) {
        this.productCode = productCode;
        return this;
    }

    public String getLogo() {
        return logo;
    }

    public ProductEnum setLogo(String logo) {
        this.logo = logo;
        return this;
    }

    public int getTailNum() {
        return tailNum;
    }

    public ProductEnum setTailNum(int tailNum) {
        this.tailNum = tailNum;
        return this;
    }

    public static ProductEnum getEnumByProductCode(String productCode) {
        for (ProductEnum productEnum : ProductEnum.values()) {
            if (productEnum.getProductCode().equals(productCode)) {
                return productEnum;
            }
        }
        return null;
    }
}
